package here.android.herehelper;

import here.android.data.GLOBALDATA;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class hereServiceBroadcastReceiver extends BroadcastReceiver
{
	private static String	TAG				= hereServiceBroadcastReceiver.class
													.getName( );
	private static String	START_ACTION	= "NotifyhereServiceStart";
	private static String	STOP_ACTION		= "NotifyhereServiceStop";
	private static Intent	m_ghereService	= new Intent( );

	@Override
	public void onReceive(Context context, Intent intent)
	{
		String action = intent.getAction( );

		if ( START_ACTION.equalsIgnoreCase(action) )
		{
			GLOBALDATA.intentContext = context;
			m_ghereService.setClass(context, hereService.class);
			context.startService(m_ghereService);
			Log.i(TAG, "here ServiceBroadcastReceiver onReceive start.");
		}
		else if ( STOP_ACTION.equalsIgnoreCase(action) )
		{
			GLOBALDATA.intentContext = context;
			m_ghereService.setClass(context, hereService.class);
			context.stopService(m_ghereService);
			Log.i(TAG, "here ServiceBroadcastReceiver onReceive stop.");
		}
	}

}
